import * as APi from '@/api/callCenter.js'
import { useRoute, useRouter } from 'vue-router'
import useUserStore from '@/store/modules/user'

export function useTransaction() {
  let fullscreenLoading = false //整页加载
  const routeParams = ref({}) //路由参数
  const router = useRouter()
  const route = useRoute()
  routeParams.value = route.query || {}
  /**
   * 获取电话记录单信息
   * @param {*} ID 客户id
   * @param {*} cd 函数
   */
  const getDetailByCustomerFn = async (ID, cd = () => {}) => {
    let Dres = await APi.getDetailByCustomer(ID)
    if (Dres.code == 200) {
      console.log(Dres.data, 'phoneRecordInfos--')
      cd(Dres.data)
    }
  }
  return {
    getDetailByCustomerFn,
    routeParams
  }
}
